<?php

/**
 * Класс RL_Stream_File -- файл в роли потока.
 * 
 * @package RL
 * @author Lucky <lucky@jetstyle.ru> 
 * @version $Id: File.php 62 2007-09-05 08:27:21Z lucky $
 */
class RL_Stream_File
{

	public $path = NULL;
	public $fp   = NULL;

	public function getPath ()
	{
		return $this->path;
	} // end of function getPath

	public function setPath ($value)
	{
		$this->path = $value;
		return $this;
	} // end of function setPath

	public function open ($mode)
	{
		$this->fp = fopen($this->getPath(), $mode);
		return $this->fp;
	} // end of function open

	public function close ()
	{
		return fclose($this->fp);
	} // end of function open

	public function read ($size)
	{
		return fread($this->fp, $size);
	} // end of function open

	public function seek ($offset, $whence=SEEK_SET)
	{
		return fseek($this->fp, $offset, $whence);
	} // end of function seek

	public function passthru ()
	{
		return fpassthru($this->fp);
	} // end of function passthru

	public function rewind ()
	{
		return rewind($this->fp);
	} // end of function rewind

	public function eof ()
	{
		return feof($this->fp);
	} // end of function eof

} // end of class RL_Stream_File


